<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<title>Hello MUI</title>
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1, user-scalable=no">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<link rel="stylesheet" href="css/mui.min.css">
		<style type="text/css">
			::-webkit-scrollbar{
				display: none;
			}
			#list {
				/*避免导航边框和列表背景边框重叠，看起来像两条边框似得；*/
				margin-top: -1px;
			}
			#kemu {
				width: 100%;
				height: 100px;
				margin-left: ;
			}
			p {
				margin-left: 20px;
				margin-right: 10px;
				color: black;
			}
			#example_question {
				margin-top: 10px;
				border-bottom: 1px #C1C1C3 solid;
				
			}
			#aaimage {
				width: 30px;
				height: 30px;
				position: absolute;
				margin-top: -5px;
			}
			#zize{
				margin-left: 40px;
				
			}
			#hei{
				height: 60px;
			}
			
		</style>
	</head>

	<body onload="selectExampleQuestion()" style="background-color: white;">
		<header class="mui-bar mui-bar-nav">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
			<h1 class="mui-title">经典例题</h1>
		</header>
		
		<div class="mui-content" style="margin-bottom: 30px; background-color: white;">
         <!--
         	经典例题列表
         -->
                 <div class="mui-card-header" id="hei">
                 	<span><img src="images/lititubiao.PNG" id="aaimage"/><span id="zize">例题试卷名</span></span>
                 	
                 </div>
                 <div id="exampleQuestionById">
                 	<div id="example_question">
                 	<p>1.官方应该是几乎覆盖技术分公司几乎覆盖数据恢复工具速度恢复公司几乎覆盖（）？</p>
                 	<p>A: 会计师副科级是否合适</p>
                 	<p style="color: red;">B: 很多司机反馈是否开始的话</p>
                 	<p>c: 换个地方就会更丰厚的</p>
                 </div>
                 
                 </div>
                 
                 
                 
                 
			
			
		</div>
		<button type="button" class="mui-btn mui-btn-success mui-icon mui-icon-plus mui-right" style="margin-bottom: 70px;">加入收藏</button>
		<nav class="mui-bar mui-bar-tab">
			<a id="defaultTab" class="mui-tab-item mui-active" href="tab-webview-subpage-about.html">
				<span class="mui-icon mui-icon-home"></span>
				<span class="mui-tab-label">首页</span>
			</a>
			<a class="mui-tab-item" href="tab-webview-subpage-chat.html">
				<span class="mui-icon mui-icon-email"><span class="mui-badge">9</span></span>
				<span class="mui-tab-label">消息</span>
			</a>
			<a class="mui-tab-item" href="#aboutus">
				<span class="mui-icon mui-icon-help"></span>
				<span class="mui-tab-label">关于我们</span>
			</a>
			<a class="mui-tab-item" href="#myown">
				<span class="mui-icon mui-icon-contact"></span>
				<span class="mui-tab-label">我的</span>
			</a>
		</nav>
		<script src="js/mui.min.js"></script>
		<script src="js/update.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript" charset="utf-8"> 
			 //mui初始化
			mui.init();
			var tpid =localStorage.getItem("tpid");
			function selectExampleQuestion(){
				mui.ajax({
			    	url:'http://127.0.0.1:8080/selectAllExampleQuestionById',
	                data:{
						tpId:tpid
					},
					dataType:'json',
					type:'post',
			    	success:function(data){
                         var testpaper_html = '';
                         console.log(data.length);
			    		   
			    		for(var i=0; i<data.length;i++){
			    			var tihao = i+1;
			    			testpaper_html += '<div id="example_question">';
			    			var answer =  data[i].eAnswer.split(",");
			    			var tureAnswer = data[i].eAnswerTrue;
			    			testpaper_html += '<p>'+tihao
			    			+'：'+data[i].eName+'</p>';
			    			for(var j=0; j<answer.length; j++){
			    				var answerSelect = answer[j].split(":")[0];
			    				
			    				if(tureAnswer==answerSelect){
			    					
			    					testpaper_html += '<p style="color: red;">'+answer[j]+'</p>';
			    				}else{
			    					testpaper_html += '<p>'+answer[j]+'</p>';
			    				};
	
			    			};
			    			testpaper_html += '</div>';
			    			
			    		};
			    		document.getElementById("exampleQuestionById").innerHTML = testpaper_html;
                  }
			    })
			}
		</script>
		
	</body>

</html>